<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>传送门</title>
<!--main style-->
<link rel="stylesheet" type="text/css" media="screen"
	href="tools/receptionbootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen"
	href="tools/receptionbootstrap/css/main.css">
<!--google font style-->
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700'
	rel='stylesheet' type='text/css'>
<!--font-family: 'Metrophobic', serif;-->
<link
	href='http://fonts.googleapis.com/css?family=Crimson+Text:400,600,400italic,600italic'
	rel='stylesheet' type='text/css'>
<!--font-family: 'Open Sans', sans-serif;-->
<!-- font icon css style-->
<link rel="stylesheet"
	href="tools/receptionbootstrap/css/font-awesome.min.css">
<link rel="stylesheet" href="tools/jqueryUi/jquery-ui.min.css">
<!-- <link type="text/css" rel="stylesheet" id="theme" href="tools/receptionbootstrap/css/jquery-ui-1.8.16.custom.css"> -->
<link type="text/css" rel="stylesheet"
	href="tools/receptionbootstrap/css/lightbox.min.css">

<script type="text/javascript">
	function REGISTER_click() {
		$("#dialog").dialog("open");
		$("#logindiv").dialog("close");
	}
	function LOGIN_click() {
		$("#logindiv").dialog("open");
		$("#dialog").dialog("close");
	}
	function ExitLOGIN_click() {
		form = $("<form></form>");
		form.attr('action', "exitlogin");
		form.attr('method', 'post');
		form.appendTo("body");
		form.css('display', 'none');
		form.submit();
	}
	function addcollectionweb() {
		$("#collectiondiv").dialog("open");
	}
	function LOGIN() {
		var LoginYZMStr = $("#LoginYZMStr").val();
		var uLoginNumber = $("#uLoginNumber").val();
		var userLoginPassword = $("#userLoginPassword").val();
		$(document).load("json/compareLoginYZM", {
			"YZMStr" : LoginYZMStr,
			"userInfo.userNumber" : uLoginNumber,
			"userInfo.userPassword" : userLoginPassword
		}, function(data) {
			var d = eval("(" + data + ")");
			if (d.tipstr == "验证成功!") {
				$("#loginform").submit();
			} else {
				$("#tipsstr").html(d.tipstr);
				$("#tipsdiv").dialog("open");
			}
		});
	}
	function REGISTER() {
		var reg = /^[0-9a-zA-Z]+$/
		var tipstr = "";
		var userName = $("#userName").val();
		var uNumber = $("#uNumber").val();
		var userPassword = $("#userPassword").val();
		var userPassword2 = $("#userPassword2").val();
		var YZMStr = $("#YZMStr").val();
		if (!userName) {
			tipstr += "用户名不能为空!<br/>"
		}
		;
		if (!uNumber) {
			tipstr += "账号不能为空!<br/>"
		}
		;
		if (!userPassword) {
			tipstr += "密码不能为空!<br/>"
		}
		;
		if (!userPassword2) {
			tipstr += "重复密码不能为空!<br/>"
		}
		;
		if (!YZMStr) {
			tipstr += "验证不能为空!<br/>"
		}
		;
		if (userName.length = 0 || userName.length > 10) {
			tipstr += "用户名要求大于0小于10字符!<br/>"
		}
		;
		if (uNumber.length<10 || uNumber.length>20) {
			tipstr += "用户账号要求大于10小于20字符!<br/>"
		}
		;
		if (userPassword.length<10 || userPassword.length>20) {
			tipstr += "用户密码要求大于10小于20字符!<br/>"
		}
		;
		if (!reg.test(uNumber)) {
			tipstr += "用户账号要求只能是数字和字母!<br/>"
		}
		;
		if (!reg.test(userPassword)) {
			tipstr += "用户密码要求只能是数字和字母!<br/>"
		}
		;
		if (!(userPassword == userPassword2)) {
			tipstr += "重复密码不一样!<br/>"
		}
		;
		if (tipstr == "") {
			$(document).load("json/userregister", {
				"userInfo.userName" : userName,
				"userInfo.userNumber" : uNumber,
				"userInfo.userPassword" : userPassword,
				"YZMStr" : YZMStr
			}, function(data) {
				var d = eval("(" + data + ")");
				if (d.tipstr == "注册成功!")
					$("#dialog").dialog("close");
				$("#tipsstr").html(d.tipstr);
				$("#tipsdiv").dialog("open");
			});
		} else {
			$("#tipsstr").html(tipstr);
			$("#tipsdiv").dialog("open");
		}

	}
	function dialogNo() {
		$("#dialog").dialog("close");
		$("#logindiv").dialog("close");
	}
	function getYZM() {
		$("#YZM").attr("src", "getYZM?timestamp=" + new Date().getTime());
	}
	function getLoginYZM() {
		$("#LoginYZM").attr("src",
				"getLoginYZM?timestamp=" + new Date().getTime());
	}
</script>
</head>



<body onLoad="load()" onUnload="GUnload()">
	<div id="collectiondiv" title="添加收藏网址">
		<form action="addcollectionweb" method="post">
			<table style="width: 100%; text-align: center;">
				<tr>
					<td><div class="input-group-ml"><span class="input-group-addon">网站名</span>
					<input id="userCollectionWebName" name="userCollection.userCollectionWebName" type="text"class="form-control">
					</div></td>
				</tr>
				<tr>
					<td><div class="input-group-ml"><span class="input-group-addon">网站地址</span>
					<input id="userCollectionWebAddress" name="userCollection.userCollectionWebAddress" type="text"class="form-control">
					</div></td>
				</tr>
				<tr>
					<td><input type="submit"class="btn btn-info" value="确定">
					<input type="reset" class="btn btn-info" value="重置"></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="tipsdiv" title="提示!">
		<span style="color: red" id="tipsstr"></span>
	</div>
	<div id="dialog" title="REGISTER">
		<form action="">
			<input type="hidden" id="userId" name="userInfo.userId"> <input
				type="hidden" id="userNumber" name="userInfo.userNumber">
			<table style="width: 100%; text-align: center;">
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">用户名(大于0小于10字符)</span><input
								id="userName" name="userInfo.userName" type="text"
								class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">用户账号(数字,字母,大于10小于20字符)</span><input
								id="uNumber" name="userInfo.userNumber" type="text"
								class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">用户密码(数字,字母,大于10小于20字符)</span><input
								id="userPassword" name="userInfo.userPassword" type="password"
								class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">重复密码</span><input
								id="userPassword2" type="password" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">验证码</span><input id="YZMStr"
								name="YZMStr" type="text" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<img onclick="getYZM()" src="getYZM" id="YZM"
								style="cursor: hand;" alt="看不清，换一张" />
						</div>
					</td>
				</tr>
				<tr>
					<td><input onclick="REGISTER()" type="button"
						class="btn btn-info" value="注册"> <input
						onclick="dialogNo()" type="button" class="btn btn-info" value="取消">
						<input onclick="LOGIN_click()" type="button" class="btn btn-info"
						value="切换登陆"></td>
				</tr>
			</table>
		</form>
	</div>
	<div id="logindiv" title="LOGIN">
		<form id="loginform" action="userlogin" method="post">
			<table style="width: 100%; text-align: center;">
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">用户账号</span><input
								id="uLoginNumber" name="userInfo.userNumber" type="text"
								class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">用户密码</span><input
								id="userLoginPassword" name="userInfo.userPassword"
								type="password" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<span class="input-group-addon">验证码</span><input id="LoginYZMStr"
								name="YZMStr" type="text" class="form-control">
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<div class="input-group-ml">
							<img onclick="getLoginYZM()" src="getLoginYZM" id="LoginYZM"
								style="cursor: hand;" alt="看不清，换一张" />
						</div>
					</td>
				</tr>
				<tr>
					<td><input onclick="LOGIN()" type="button"
						class="btn btn-info" value="登陆"> <input
						onclick="dialogNo()" type="button" class="btn btn-info" value="取消">
						<input onclick="REGISTER_click()" type="button"
						class="btn btn-info" value="切换注册"></td>
				</tr>
			</table>
		</form>
	</div>

	<!-- Preloader -->
	<div id="preloader">
		<div id="status"></div>
	</div>
	<!--wrapper start-->
	<div class="wrapper noGap" id="wrapper">

		<!--Header start -->
		<header> <!--menu start-->
		<div class="menu">
			<!-- <a href="#" class="nav-icon" id="nav-show"><i class="fa fa-bars"></i></a> -->
			<!--  <div class="navbar-wrapper"> -->
			<s:if test="#session.userInfo.userName !=''">
				<button onclick="ExitLOGIN_click()" class="btn" style="color: black">注销</button>
			</s:if>
			<s:else>
				<button onclick="LOGIN_click()" class="btn" style="color: black">LOGIN</button>
				<button onclick="REGISTER_click()" class="btn" style="color: black">REGISTER</button>
			</s:else>
			<span style="color: black; font-size: large; font-weight: bold">
				用户: <s:if test="#session.userInfo.userName !=''">
					<s:property value="#session.userInfo.userName" /> 积分:<s:property
						value="#session.userInfo.userCore" />
				</s:if> <s:else>
			游客 积分:0
			</s:else>

			</span>
			<div class="container" style="position: fixed; width: 40%">
				<div class="navwrapper">
					<div class="navbar navbar-inverse navbar-static-top">
						<div class="container">
							<!-- <div class="logo">logo</div> -->
							<div class="navArea">

								<!-- <a href="#" class="closeMenu"><i class="fa fa-times"></i></a> -->
								<div class="navbar-header">
									<button type="button" class="navbar-toggle"
										data-toggle="collapse" data-target=".navbar-collapse">
										<span class="icon-bar"></span> <span class="icon-bar"></span>
										<span class="icon-bar"></span>
									</button>
									<!--   <a class="navbar-brand" href="#">Menu</a> -->

								</div>
								<div class="navbar-collapse collapse">
									<ul class="nav navbar-nav">
										<li class="menuItem"><a href="#wrapper"
											style="color: black; font-size: x-large; font-weight: bold">主页</a></li>
										<li class="menuItem"><a href="#Movies"
											style="color: black; font-size: x-large; font-weight: bold">影视</a></li>
										<li class="menuItem"><a href="#technology"
											style="color: black; font-size: x-large; font-weight: bold">技术</a></li>
										<li class="menuItem"><a href="#Resources"
											style="color: black; font-size: x-large; font-weight: bold">资源</a></li>
										<li class="menuItem"><a href="#Collection"
											style="color: black; font-size: x-large; font-weight: bold">个人收藏</a></li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- End Navbar -->
			</div>
			<!-- </div>  -->
		</div>
		<!--menu end--> <!--banner start-->
		<div class="banner row" id="banner"
			style="background-image: url(tools/receptionbootstrap/images/header-image/背景main.jpg); background-size: 100% 100%; -moz-background-size: 100% 100%; -webkit-background-size: 100% 100%;">
			<!-- <div class="bannerText">
        <h1>传 送 门</h1>
        <h3>找 寻 专 属 于 你 的 空 间</h3>
      <!-- </div> -->
			<!--  <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 noPadd slides-container" style="height:100%"> 
        background slide show start
        <div class="slide"> 
          <img src="tools/receptionbootstrap/images/header-image/image01.png" alt="image01"> </div>
        <div class="slide"> 
          <img src="tools/receptionbootstrap/images/header-image/image02.jpg" alt="image01"> </div>
        background slide show end 
     <!--  </div> -->
		</div>
		<!--banner end--> </header>
		<!--Header end -->
		<!--影视 -->
		<section id="Movies" class="myexperties">
		<div style="background-color: LightGrey">
			<div class="container">
				<div class="heading">
					<h2>影视</h2>
				</div>

				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">视频网站</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type1"></p>
					</div>
				</div>
				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">电影下载</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type2"></p>
					</div>
				</div>
				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div style="line-height: 100%" class="expertiesico">电影论坛</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type3"></p>
					</div>
				</div>
			</div>
		</div>
		</section>
		<!--Work Experties end -->
		<!--技术 -->
		<section id="technology" class="myexperties">
		<div style="background-color: LightGrey">
			<div class="container">
				<div class="heading">
					<h2>技术</h2>
				</div>

				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">技术论坛</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type4"></p>
					</div>
				</div>
				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">自学站</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type5"></p>
					</div>
				</div>
			</div>
		</div>
		</section>
		<!--资源 -->
		<section id="Resources" class="myexperties">
		<div style="background-color: LightGrey">
			<div class="container">
				<div class="heading">
					<h2>资源</h2>
				</div>

				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">福利站</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type6"></p>

					</div>
				</div>
				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">工具</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type7"></p>
					</div>
				</div>
			</div>
		</div>
		</section>
		<!--Work Experties end -->
		<!--个人收藏 -->
		<section id="Collection" class="myexperties">
		<div style="background-color: LightGrey">
			<div class="container">
				<div class="heading">
					<h2>个人收藏</h2>
				</div>
				<div class="row media">
					<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
						<div class="expertiesico">收藏</div>
					</div>
					<div class="expertiesdesc col-xs-12 col-sm-9 col-md-9 col-lg-9">
						<p id="type8">
							<s:if test="#session.userInfo.userName !=''">
								<button onclick="addcollectionweb()" class="btn"
									style="color: black">添加收藏网址</button>
								<s:iterator value="session.userCollections" status="stat" var="suc">
									<a href=<s:property value="#suc.userCollectionWebAddress"/> target="_blank" class="btn btn-primary btn-lg">
										<s:property value="#suc.userCollectionWebName" />
									</a>
								</s:iterator>
							</s:if>
						</p>
					</div>
				</div>
			</div>
		</div>
		</section>
	</div>
	<!--wrapper end-->

	<!--modernizr js-->
	<script type="text/javascript"
		src="tools/receptionbootstrap/js/modernizr.custom.26633.js"></script>
	<!--jquary min js-->
	<script type="text/javascript"
		src="tools/receptionbootstrap/js/jquery.min.js"></script>
	<script src="tools/receptionbootstrap/js/bootstrap.min.js"></script>

	<!--for placeholder jquery-->
	<script type="text/javascript"
		src="tools/receptionbootstrap/js/jquery.placeholder.js"></script>

	<!--for header jquery-->
	<script type="text/javascript"
		src="tools/receptionbootstrap/js/stickUp.js"></script>
	<script src="tools/receptionbootstrap/js/jquery.superslides.js"
		type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		jQuery(function($) {
			$(document)
					.ready(
							function() {
								//enabling stickUp on the '.navbar-wrapper' class
								/* $('.navbar-wrapper').stickUp({
									parts: {
									  0: 'banner',
									  1: 'Movies',
									  2: 'technology',
									  3: 'Resources',
									  4: 'Collection'
									},
									itemClass: 'menuItem',
									itemHover: 'active',
									topMargin: 'auto'
								}); */
								$("#dialog").dialog({
									autoOpen : false
								});
								$("#tipsdiv").dialog({
									autoOpen : false
								});
								$("#logindiv").dialog({
									autoOpen : false
								});
								$("#collectiondiv").dialog({
									autoOpen : false
								});
								$(document)
										.load(
												"json/getAllWeb",
												{},
												function(data) {
													var d = eval("(" + data
															+ ")");
													$
															.each(
																	d.allweb,
																	function(
																			count,
																			webinfo) {
																		/* 	视频网站 电影下载 电影论坛 技术论坛 自学站 福利站 工具 */
																		switch (webinfo.webType) {
																		case "视频网站":
																			$(
																					"#type1")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "电影下载":
																			$(
																					"#type2")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "电影论坛":
																			$(
																					"#type3")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "技术论坛":
																			$(
																					"#type4")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "自学站":
																			$(
																					"#type5")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "福利站":
																			$(
																					"#type6")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		case "工具":
																			$(
																					"#type7")
																					.append(
																							"<a href="+webinfo.webAddress+" target='_blank' class='btn btn-primary btn-lg'>"
																									+ webinfo.webName
																									+ "</a> ");
																			break;
																		}
																		/* alert(count+':'+webinfo.webId+":"+webinfo.webName+":"+webinfo.webAddress+":"+webinfo.webBigType+":"+webinfo.webType);  */
																	});
												})
							});
		});
	</script>
	<script>
		$('#banner').superslides({
			animation : 'fade',
			play : 5000
		});
	</script>

	<!--for portfolio jquery-->
	<script src="tools/receptionbootstrap/js/jquery.isotope.js"
		type="text/javascript"></script>


	<%-- <script type="text/javascript" src="tools/receptionbootstrap/js/jquery.ui.widget.min.js"></script> 
<script type="text/javascript" src="tools/receptionbootstrap/js/jquery.ui.rlightbox.js"></script>  --%>
	<script type="text/javascript" src="tools/jqueryUi/jquery-ui.min.js"></script>
	<!--contact form js-->
	<script type="text/javascript"
		src="tools/receptionbootstrap/js/jquery.contact.js"></script>


	<script src="tools/receptionbootstrap/js/jquery.easing.js"></script>
	<script src="tools/receptionbootstrap/js/jquery.mousewheel.js"></script>
	<script defer src="tools/receptionbootstrap/js/slideroption.js"></script>

	<!--for theme custom jquery-->
	<script src="tools/receptionbootstrap/js/custom.js"></script>


</body>
</html>